PELogOnSQLServerWithPrivateInfo

Use PELogOnSQLServerWithPrivateInfo to enable the Crystal Report Engine to "piggyback" your application's existing connection to a Server. If you are already logged on, this function lowers the number of connections established by a workstation, thus reducing application time and network traffic. It also prevents a Crystal Reports Log Off call from disconnecting an application's existing connection to the Server.

C Syntax
BOOL CRPE_API PELogOnSQLServerWithPrivateInfo (
        const char FAR *dllName,    
        void FAR *privateInfo );
Parameters

dllName

Specifies a pointer to the name of the Crystal Reports DLL that was used in establishing the connection to the server when the report was first created. For example, if a report was created using an ODBC datasource, the Crystal Reports DLL is PDSODBC.DLL.

privateInfo

In the application, a connection to the server has to have been established and this in turn generates a Handle to a Database Connection (HDBC). This parameter specifies the application's handle to the connection. This makes Crystal Reports aware of the existing connection so it can use it instead of establishing a new one. Since the reports with which this function works are based on ODBC, this parameter is actually an ODBC HDBC.

Returns
Remarks

If the application uses ODBC to connect, get the ODBC HDBC by using the following function calls. Also, see the ODBC documentation for more information.

SQLAllocEnv
«Initializes the ODBC call level interface and allocates memory for an environment handle.»
SQLAllocConnect
«Returns an ODBC HDBC.»
VB Syntax
Declare Function PELogOnSQLServerWithPrivateInfo Lib "crpe32.dll" ( 
ByVal DLLName As String, ByVal PrivateInfo As Long ) As Integer
Delphi Syntax
function PELogOnSQLServerWithPrivateInfo (
    dllName: PChar;
    privateInfo: Pointer
    ): Bool stdcall;


Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com